<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jquery-3.5.1.min.js"></script>
</head>

<body>
    <button id='btn1'>提交</button>
    <script>
        console.log('hi');
        setTimeout(function cb1() {
            console.log('cb1'); //cb 即callback
        }, 5000);

        console.log('Bye');


        console.log('hi');
        $('#btn1').click(function (e) {
            console.log('button clicked');
        })
        console.log('Bye');

    // 以上两者都是回调，区别在于触发的时机不同
    // 前者是在5秒之后触发，后者是在点击button的时候触发的
    </script>
</body>

</html>